(function(){
    var pl=document.querySelector(".productList")
    const xhr=new XMLHttpRequest();

xhr.open("get","http://chst.vip:1234/api/getmoneyctrl",true);
xhr.send(null);
xhr.onreadystatechange = function(){
        if(xhr.readyState === 4){
            if(xhr.status === 200){
                let res = JSON.parse(xhr.responseText);
                console.log(res.result[1]);
                let regExp = /(?<=imgurl=)[^'"]*/;
                let ele = "";
                res.result.forEach(item => {
                    // console.log(item);
                    var img = regExp.exec(item.productImg2)[0];
                    ele += `<div productId="${item.productId}">
                            <img src="${img}" alt="">
                            <h5>${item.productName}</h5>
                            <p>${item.productPinkage}</p>
                            <span>${item.productTime}</span>
                        </div>`
                });
                pl.innerHTML = ele;
            }
        }
    }
})